<template>
  <div class="goods">
    <page-search
      :searchFormConfig="searchFormConfig"
      @handleResetBtnClick="handleResetBtnClick"
      @handleSearchBtnClick="handleSearchBtnClick"
    ></page-search>
    <page-content
      pageName="goods"
      :tableConfig="contentTableConfig"
      ref="pageContentRef"
    >
      <template #oldPrice="scope">{{ '￥' + scope.row.oldPrice }}</template>
    </page-content>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue';
import pageContent from '@/components/page-content/index';
import pageSearch from '@/components/page-search';
import { contentTableConfig } from './config/content.config';
import { searchFormConfig } from './config/search.config';
import { usePageSearch } from '@/hooks/use-page-search';

export default defineComponent({
  components: {
    pageContent,
    pageSearch
  },
  name: 'goods',
  setup() {
    const [pageContentRef, handleResetBtnClick, handleSearchBtnClick] =
      usePageSearch();
    return {
      contentTableConfig,
      searchFormConfig,
      pageContentRef,
      handleResetBtnClick,
      handleSearchBtnClick
    };
  }
});
</script>

<style scoped lang="less"></style>
